﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;

namespace FwProject.WXMiddleware
{
    /// <summary>
    /// 支付宝 支付服务
    /// </summary>
    public static class WxChartServiceCollectionExtensions
    {
        public static IServiceCollection AddWxChart(this IServiceCollection services, Action<WxChartOptions> options)
        {
            if (services == null)
                throw new ArgumentNullException(nameof(services));

            if (options == null)
                throw new ArgumentNullException(nameof(options));
            services.AddOptions();
            services.Configure(options);
            services.AddScoped<IWxChartService, WxChartService>();
            return services;
        }
    }
}
